package com.example.szh;

import android.app.Application;
import android.content.Context;

import com.example.szh.db.DBManager;
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager;
import com.shuyu.gsyvideoplayer.player.PlayerFactory;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.commonsdk.statistics.common.DeviceConfig;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.UMShareConfig;

import update.UpdateAppUtils;

//import com.sina.weibo.sdk.WbSdk;

public class App  extends Application {

    private static App instance;


    public static App getInstance(){
        return instance;
    }





    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        UpdateAppUtils.init(this);
        DBManager.getInstance().init(this);
        UMConfigure.setLogEnabled(true);
        UMConfigure.init(this,"6007eaf04dd73302634b9177"
                ,"umeng",UMConfigure.DEVICE_TYPE_PHONE,"a2148df99a7d189b7f3d0730cbbdc81f");//58edcfeb310c93091c000be2 5965ee00734be40b580001a0

        PlayerFactory.setPlayManager(IjkPlayerManager.class);
        PlatformConfig.setSinaWeibo("2307040012","a575b8e63348e3c970babfc3bb2d3b91","https://api.weibo.com/oauth2/default.html");
        UMShareConfig config = new UMShareConfig();
        config.isNeedAuthOnGetUserInfo(true);
        UMShareAPI.get(this).setShareConfig(config);

    }

    public static String[] getTestDeviceInfo(Context context){
        String[] deviceInfo = new String[2];
        try {
            if(context != null){
                deviceInfo[0] = DeviceConfig.getDeviceIdForGeneral(context);
                deviceInfo[1] = DeviceConfig.getMac(context);
            }
        } catch (Exception e){
        }
        return deviceInfo;
    }
}
